<template>
  <el-button v-show="isShow"><slot></slot></el-button>
</template>
<script lang="ts">
import { defineComponent } from "vue";

export default defineComponent({
  name: "myButton",
});
</script>
<script setup lang="ts">
import { computed } from "vue";
import { setUserStore } from "@/stores/user";
import { storeToRefs } from "pinia";
const userStore = setUserStore();
const { userInfo } = storeToRefs(userStore);
const props = defineProps<{ permission: string }>();
const isShow = computed(() => {
  return userInfo.value.buttons.includes(props.permission);
});
</script>
<style scoped></style>
